<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			{{msg}}
		</div>

		<script type="text/javascript">
			var vm = new Vue({
				el: "#app",
				data: {
					msg: "hi vue"
				},
				beforeCreate:function(){
					console.log('beforeCreate');
				},
				created:function(){
					console.log("created");
				},
				beforeMount:function(){
					console.log("beforeMount");
				},
				mounted:function(){
					console.log("mounted");
				},
				// 文字更新动作触发
				beforeUpdate:function(){
					console.log("beforeUpdate");
				},
				updated:function(){
					console.log("updated");
				}
			});
			
			// 3秒钟后修改文字
			setTimeout(function() {
				vm.msg = "3 second later";
			}, 3000);
		</script>
	</body>
</html>
